package com.financing.wap.dao.impl;


import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Repository;
import com.financing.wap.dto.SalesPrizesLogDTO;
import com.financing.wap.dao.ISalesPrizesLogDao;
import com.financing.wap.common.SqlName;
/**
 * sales_prizes_log  
 * 抽奖记录 数据访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("salesPrizesLogDao")
public class SalesPrizesLogDaoImpl extends BaseDaoImpl<SalesPrizesLogDTO, java.lang.Integer> implements ISalesPrizesLogDao {


	@Override
	public int insert(SalesPrizesLogDTO salesPrizesLog) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.insert(SqlName.SalesPrizesLogSql.insert, salesPrizesLog);
	}

	@Override
	public void update(SalesPrizesLogDTO salesPrizesLog) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.SalesPrizesLogSql.update, salesPrizesLog);
	}

	@Override
	public void updateForce(SalesPrizesLogDTO salesPrizesLog) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.SalesPrizesLogSql.updateForce, salesPrizesLog);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		this.sqlMapClientTemplate.delete(SqlName.SalesPrizesLogSql.delete,id);
	}
	
	@SuppressWarnings("unchecked")	
	@Override
	public List<SalesPrizesLogDTO> queryList(SalesPrizesLogDTO salesPrizesLog) throws SQLException {
		return this.sqlMapClientTemplate.queryForList(SqlName.SalesPrizesLogSql.queryList, salesPrizesLog);
	}

	@Override
	public int queryListCount(SalesPrizesLogDTO salesPrizesLog) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.queryForObject(SqlName.SalesPrizesLogSql.queryListCount, salesPrizesLog);
	}

	@Override
	public SalesPrizesLogDTO loadById(Integer id) throws SQLException {
		return  (SalesPrizesLogDTO)this.getSqlMapClientTemplate().queryForObject(SqlName.SalesPrizesLogSql.loadById,id);
	}

	@Override
	public Class<SalesPrizesLogDTO> getEntityClass() {
		return SalesPrizesLogDTO.class;
	}
 	
}
